<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="${staticServer}/inc/style/main.css" />
<link rel="stylesheet" href="${staticServer}/inc/style/page.css" />
<link rel="stylesheet" href="${staticServer}/css/struct_info.css" />
<script src="${staticServer}/inc/js/jquery.js"></script>
<script src="${staticServer}/inc/js/pageset.js"></script>
<script src="${staticServer}/inc/js/submitter.js"></script>
<script src="${staticServer}/inc/js/infopad.js?2.2"></script>

<link rel="stylesheet" href="${staticServer}/css/consultant_client.css" />
	
<link rel="stylesheet" href="${staticServer}/inc/style/date/datepicker.css" />
<script src="${staticServer}/inc/js/datepicker.js"></script>

<style>
#SWFUpload_0{
	margin-top: 70px;
    margin-left: -30px;
}
</style>
<script>


var add_Period = function(){
	var id = $("#id").val();
	var centre = $("#centre").val();
	var username = $("#target").val();
	var type = $("#type").val();
	var station = $("#station").val();
	var state = $("#state").val();
	var beizhu = $("#beizhu").val();
		if(centre==""){
		infopad.err("请选择中心");
		return;
	}
	if(username==""){
		infopad.err("请选择老师姓名");
		return;
	}

	if(type==""){
		infopad.err("请选择评价");
		return;
	}
	if(station==""){
		infopad.err("请选择职位");
		return;
	}
	if(state==""){
		infopad.err("请选择状态");
		return;
	}
	$.post("${contextPath}/index/add_period.json", {
		    "id":id,
		    "username":username,
			"type":type,
			"centre":centre,
			"station":station,
			"state":state,
			"beizhu":beizhu
		}, function(ms) {
		   var msg = ms.msg;
		   if(msg!=null && msg=="1"){
			   infopad.msg("操作成功！");
			   window.location.href="${contextPath}/index/periodList.htm";
		   }else if(msg!=null && msg=="2"){
		       infopad.err("不在操作时间，请在每月的15到20之间添加");
		   }else if(msg!=null && msg=="3"){
		       infopad.msg("本月已经添加过，请去修改");
		   }
			
	});
}


$(function(){
	$("#sy_user").keyup(function(){
		var nickname = $("#sy_user").val();
		$("#b").prop( "checked", false );
		$("#c").prop( "checked", false );
		$("#d").prop( "checked", false );
		$("#e").prop( "checked", false );
		$("#f").prop( "checked", false );
		$("#j").prop( "checked", false );
		$("#h").prop( "checked", false );
		$("#i").prop( "checked", false );
		$("#j").prop( "checked", false );
		$("#k").prop( "checked", false );
		
		$.post("${contextPath}/index/getUserByNickname.json", {
			"nickname" : nickname
		}, function(ms) {
			 if(ms.user!=null){
			 	var userna = ms.user.username;
			 	$("#target").val(userna);
			 	var a = $("#target").val()
			 	if(a==null || a==""){
			 		$("#a").prop( "checked", false );
					$("#b").prop( "checked", false );
					$("#c").prop( "checked", false );
					$("#d").prop( "checked", false );
					$("#e").prop( "checked", false );
					$("#f").prop( "checked", false );
					$("#j").prop( "checked", false );
					$("#h").prop( "checked", false );
					$("#i").prop( "checked", false );
					$("#j").prop( "checked", false );
					$("#k").prop( "checked", false );
			 	}else{
			 		target_changed();
			 	}
			 	
			 }
			
		});
	});
});
$(function(){
	$( "#target" ).change( target_changed );
});


</script>
</head>
<input type="hidden" id="id" value="<#if period??>${period.id}</#if>">
<body>
	<div id="home_link">
		<ul>
			<li></li>
			<li>&gt;</li>
			<li>组织架构</li>
			<li>&gt;</li>
			<li class="current">title</li>
		</ul>
	</div>

	<div id="container">
		<div id="title">添加员工反馈情况</div>
		<table id="infotable">
			
			<tr>
				<th>中心:</th>
				<td>
					<select id="centre" >
					<option value="<#if period??>${period.centre}</#if>"><#if period??>${period.centre}</#if></option>
	            		<#if office_List??>
	              			<#list office_List as ls>
	              				<option value="${ls.name}">${ls.name}</option>
	              			</#list>
	            		</#if>
	            	</select>	
				</td>
			</tr>
			<tr>
				<th>老师名称:</th>
				<td>
				    <select id="target" >
	                      <option value="<#if period??>${period.username}</#if>"><#if period??>${period.name}</#if></option>
		                	<#if sylist??>
							<#list sylist as ls>
		                		<option value="${ls.username}">${ls.nickname1}（${ls.departments}-${ls.job}）</option>
		                	</#list>
		                </#if>
	            </select>	
	            	<input id="sy_user" type="text" value="" placeholder="快速搜索" />
				</td>
			</tr>
	         <tr>
				<th>选择岗位:</th>
				<td>
					<select id="station">
						<option value="">请选择</option>
						<option value="1">中心销售</option>
						<option value="2">销售主管</option>
						<option value="3">区域主管</option>
						<option value="4">家庭教师</option>
						<option value="5">训练老师</option>
						<option value="6">课程顾问</option>
						<option value="7">区域监管</option>
						<option value="8">培训副主管</option>
						<option value="9">在线课程顾问</option>
						<option value="10">行政前台</option>
						<option value="11">培训副主管</option>
						<option value="12">市场专员</option>
						<option value="13">幼教老师</option>
						<option value="14">运营督导</option>
						<option value="15">招聘专员</option>
						<option value="16">中心班主任</option>
					</select>
				</td>
			</tr>
			<tr>
				<th>状态:</th>
				<td>
				<select id="state">
						<option value="">请选择</option>
						<option value="12">5天考核期内</option>
						<option value="1">试用期</option>
						<option value="2">建议辞退</option>
						<option value="3">转正，稳定</option>
						<option value="4">转正，有离职打算</option>
						<option value="5">转正、已经提出离职</option>
						<option value="6">怀孕在岗</option>
						<option value="7">怀孕，停薪留职</option>
						<option value="8">停薪留职</option>
						<option value="9">新中心储备人员</option>
						<option value="10">临时调动中心人员</option>
						<option value="11">其他，请在备注注明</option>
					</select>
				</td>
			</tr>
			<tr>
				<th>评价:</th>
				<td>
					<select id="type">
						<option value="">请选择</option>
						<option value="1">优秀</option>
						<option value="2">良好</option>
						<option value="3">及格</option>
						<option value="4">建议调改</option>
						<option value="5">建议辞退</option>
					</select>
				</td>
			</tr>
			<tr>
				<th>备注:</th>
				<td>
				    <textarea name="beizhu" id="beizhu" rows="5" cols="30" value="<#if period??>${period.beizhu}</#if>"><#if period??>${period.beizhu}</#if></textarea>
				</td>
			</tr>
			
		</table>
		
		<div id="controlbar">
			<input type="button" class="submit" onclick="add_Period()" value="  保  存  " />
		</div>
	</div>
	
</body>
</html>